CC=gcc
OPT=-g -Wall -D_FILE_OFFSET_BITS=64 -D__FreeBSD__=10 -DFUSE_USE_VERSION=26
INCL=-I/usr/local/include
LIB=-L/usr/local/lib -lfuse
RM=rm
LEX=lex
YACC=yacc

tfs:
	$(LEX) tfs_conf.l
	$(YACC) -d tfs_conf.y
	$(CC) $(OPT) $(INCL) $(LIB) lex.yy.c y.tab.c $@.c $@_conf.c -o $@

#	$(CC) $(OPT) $(INCL) $(LIB) -o $@ $@.c
#	$(CC) $(OPT) $(INCL) $(LIB) -o $@ $@.c $@_check.c
#	$(CC) $(OPT) $(INCL) $(LIB) $@.c
#	$(CC) $(OPT) $(INCL) $(LIB) $@_check.c
#	$(CC) $(OPT) $(INCL) $(LIB) -o tfs $@_check.o $@.o

mount:
#	./tfs /Users/msantos/mnt/test:/Volumes/opt -d -ovolname=tfs -oping_diskarb | egrep "tfs_(throttle|check)"
#	./tfs /Users/msantos/mnt/test:/Volumes/opt -d | egrep "tfs_(throttle|check)"
	./tfs /Users/msantos/mnt/test:/Volumes/opt -d > /dev/null 2>&1

clean:
	-@$(RM) tfs tfs.tab.c tfs.tab.h lex.yy.c y.tab.c y.tab.h
